import request from '@/utils/request'
export function getEmpListApi(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params

  })
}

/**
 * 导出员工的excel
 * **/

export function exportEmployeeApi() {
  return request({
    url: '/sys/user/export',
    // 改变接收数据的类型
    responseType: 'blob' // 使用blob接收二进制文件流
  })
}
export function getImportTpl() {
  return request({
    url: '/sys/user/import/template',
    // 改变接收数据的类型
    method: 'get',
    responseType: 'blob' // 使用blob接收二进制文件流
  })
}
export const getEmpInfoApi = (id) => {
  return request({
    url: '/company/department/' + id,
    method: 'get'

  })
}
export const addEmpApi = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data

  })
}
export const editEmpApi = (data) => {
  return request({
    url: '/sys/user/' + data.id,
    method: 'put',
    data

  })
}
export const delEmpeApi = (id) => {
  return request({
    url: '/sys/user/' + id,
    method: 'delete'

  })
}
/**
 * 删除员工
 * **/

export const uploadExcelApi = (data) => {
  return request({
    url: '/sys/user/import',
    method: 'post',
    data

  })
}

